package com.xs;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.FutureTask;

/**
 * @program: paxos-java-demo
 * @description
 * @author: wzx
 * @create: 2021-07-08 18:42
 **/
public class PaxosDemo {

    public static void main(String[] args) {
        Proposer p1=new Proposer("P1"); //提议1
        Proposer p2=new Proposer("p2"); //提议2
        Proposer p3=new Proposer("p3"); //提议3

        List<Acceptor> acceptors=new CopyOnWriteArrayList<>(); // 投票者

        for (int i = 0; i < 5; i++) {
            String s="A"+i;
            acceptors.add(new Acceptor(s));
        }
        p3.vote(new Proposal(0,"23"),acceptors);
    }
}
